package com.tsunami.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tsunami.authority.dto.auth.UserDTO;
import com.tsunami.authority.entity.auth.User;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author lx
 * @since 2021-09-23
 */
public interface UserMapper extends BaseMapper<User> {

    User selectByAccount(@Param("account") String account);

    Page<User> selectPageList(@Param("page") Page<User> page, @Param("user") UserDTO user);
    /**
     * 修改用户最后登录时间
     *
     * @param account
     * @param now
     * @return
     */
    int updateLastLoginTime(@Param("account") String account, @Param("now") LocalDateTime now);

    List<User> findUserByRoleId(@Param("roleId") Long roleId, @Param("keyword") String keyword);
}
